﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;

public partial class mobile_moresort : System.Web.UI.Page
{
    string enter_id;
    protected void Page_Load(object sender, EventArgs e)
    {
        enter_id = this.Request.Params["eid"].ToString();
        string[] sname=new string[500];
        SqlConnection sc1 = new SqlConnection(ConfigurationManager.ConnectionStrings["wbkpt"].ConnectionString.ToString());
        sc1.Open();
        SqlCommand get_sort = new SqlCommand();
        get_sort.Connection = sc1;
        get_sort.CommandText = "select SORT_NAME from INFO_SORT where ENTER_ID=@eid and SORT_LEVEL=@l";
        get_sort.Parameters.AddWithValue("@eid",enter_id);
        get_sort.Parameters.AddWithValue("@l","周边产品");
        SqlDataReader re = get_sort.ExecuteReader();
        int i = 0;

        while (re.Read())
        {
            sname[i] = re.GetString(re.GetOrdinal("SORT_NAME"));
            i++;
        }
        re.Close();

        SqlCommand get2=new SqlCommand("select ENTER_NAME from INFO_ENTER where ENTER_ID=@id",sc1);
        get2.Parameters.AddWithValue("@id",enter_id);
        string tmp=get2.ExecuteScalar().ToString();
        string result = "这些是来自" + tmp + "平台的其他产品分类，点击它们的名称查看该分类下更多产品！<br/>";
        for(int k=0;k<i;k++)
        {
        result += "<a href=\"http://lcsy2008.eicp.net/wbkpro/mobile_sortsearch.aspx?eid=" +enter_id + "&sname="+sname[k]+"\">" + sname[k] + "</a>";
        result += "<br/>";
        }
        label1.Text = result;
        sc1.Close();
    }
}